<?php
/**
 * Author:   tangxiaowen
 * Email:    846506584@qq.com
 * Date:     2021/3/3 0003 16:31
 * Describe:
 */

namespace app\manage\controller\corp;

use app\common\server\corp\{Base as BaseService, Token, Auth, Msg};

class Test extends Base
{
    /**
     * 获取SuiteTicket
     */
    public function getSuiteTicket()
    {
        $str = (new BaseService())->getSuiteTicket();
        dump($str);die;
    }

    /**
     * 获取getSuiteAccessToken
     */
    public function getSuiteAccessToken()
    {
        $str = (new Token())->getSuiteAccessToken();
        dump($str);die;
    }

    /**
     * 获取预授权码
     */
    public function getPreAuthCode()
    {
        $str = (new Auth())->getPreAuthCode();
        dump($str);die;
    }

    /**
     * 获取永久授权码
     */
    public function getPermanentByCode()
    {
        $str = (new Auth())->getPermanentByCode();
        dump($str);die;
    }

    /**
     * 获取授权链接
     */
    public function getAuthUrl($adminId = 9)
    {
        $str = (new Auth())->getAuthUrl($adminId);
        header("Location: $str");
    }

    /**
     * 发送文本消息
     */
    public function sendTextMsg()
    {
        $res = (new Msg)->sendTextMsg();
        dump($res);die;
    }

    /**
     * 回复文本消息
     */
    public function replyTextMsg()
    {
        $res = (new Msg)->replyTextMsg();
        dump($res);die;
    }
}